package com.ruoyi.api.kehu;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.JiajiaTransferAccounts;
import com.ruoyi.system.domain.vo.JiajiaTransferAccountsVo;
import com.ruoyi.system.service.IJiajiaTransferAccountsService;
import com.ruoyi.system.utils.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 微信打款Controller
 * 
 * @author ruoyi
 * @date 2025-04-25
 */
@Controller
@RequestMapping("/api/accounts")
public class ApiJiajiaTransferAccountsController extends BaseController
{

    @Autowired
    private IJiajiaTransferAccountsService jiajiaTransferAccountsService;





    /**
     * 微信打款
     */
    @Log(title = "微信打款", businessType = BusinessType.EXPORT)
    @PostMapping("/sumMoneyDetail")
    @ResponseBody
    public List<JiajiaTransferAccountsVo> sumMoneyDetail(JiajiaTransferAccounts jiajiaTransferAccounts)
    {
        logger.info("进入sumMoneyDetail");
        jiajiaTransferAccounts.setUserId(TokenUtil.getUid());
        jiajiaTransferAccounts.setDeleted("1");
        List<JiajiaTransferAccountsVo> list = jiajiaTransferAccountsService.selectJiajiaTransferAccountsList(jiajiaTransferAccounts);
        return list;
    }


    /**
     * 修改保存微信打款
     */
    @Log(title = "微信打款", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(JiajiaTransferAccounts jiajiaTransferAccounts)
    {
        return toAjax(jiajiaTransferAccountsService.updateJiajiaTransferAccounts(jiajiaTransferAccounts));
    }

}
